
{include file="public/head" /}
    

</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content">
        <div class="row">
            <div class="ibox float-e-margins">
                <div class="ibox-title">个人资料</div>
                <div class="ibox-content">
                    <div class="row">
                        <div class="layui-form">
                            <div class="layui-form-item">
                                <label class="layui-form-label">姓名</label>
                                <div class="layui-input-block">
                                    <input type="text" name="t_name" maxlength="20" required  lay-verify="required" autocomplete="off" class="layui-input" placeholder="真实姓名" value="{$data.t_name}">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">班级号</label>
                                <div class="layui-input-block">
                                    <input type="text" name="class_id" required  placeholder="班级号" lay-verify="required" autocomplete="off" class="layui-input" value="{$data.class_id}" readonly>
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">手机</label>
                                <div class="layui-input-block">
                                    <input type="text" name="tel" required  placeholder="手机" lay-verify="required" autocomplete="off" class="layui-input" value="{$data.tel}">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">微信</label>
                                <div class="layui-input-block">
                                    <input type="text" name="wechat" required  placeholder="微信" lay-verify="required" autocomplete="off" class="layui-input" value="{$data.wechat}">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">办公</label>
                                <div class="layui-input-block">
                                    <input type="text" name="offline" required  placeholder="办公室位置" lay-verify="required" autocomplete="off" class="layui-input" value="{$data.offline}">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label">验证码</label>
                                <div class="layui-input-block">
                                    <input type="text" name="code" required  placeholder="点击图片更换验证码" lay-verify="required" autocomplete="off" class="layui-input">
                                </div>
                            </div>
                            <div class="layui-form-item">
                                <label class="layui-form-label"></label>
                                <div class="layui-input-block">
                                    <img src="{:captcha_src()}" onclick="javascript:this.src='{:captcha_src()}?tm='+Math.random()"  style="width: 200px; height: 50px;margin-top: 10px;" />
                                </div>
                            </div>
                            <button type="submit" class="layui-btn layui-btn-normal" lay-submit="" lay-filter="component-form-element">注册</button>
                            <button type="reset" class="layui-btn layui-btn-warm">重置</button>
                            <!--            </form>-->
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
<!-- 全局js -->
    {include file="public/footer" /}
    <script>
        //Demo
        layui.use('form', function(){
            var form = layui.form;
            //监听提交
            form.on('submit(component-form-element)', function (data) {
                var index = layer.load();
                $.ajax({
                    url:"{:url('teacher/index/person')}",
                    type:'post',
                    dataType:'json',
                    data:data.field,
                    success:function(res){
                        layer.close(index);
                        if (res.data == 1) {
                            layer.open({
                                title: '修改资料'
                                ,content: res.message
                                ,yes: function(layero, index){
                                    setTimeout('window.location.reload()',1000);
                                }
                            });
                        } else if (res.data == 0) {
                            layer.open({
                                title: '修改资料'
                                ,content: res.message
                            });
                        } else {
                            layer.open({
                                title: '修改资料'
                                ,content: '出现未知错误，如果问题一直出现，您可以联系管理员或站点留言'
                            });
                        }
                    }
                })
            });
        });
    </script>
</body>
</html>
